@extends('admin.editor.layout.layout')
@section('content')
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                书籍修改
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-lg-6 col-lg-offset-3">
                        @if(session('error'))
                        <div class="alert alert-danger">
                            {{session('error')}}
                        </div>    
                        @endif
                        <form role="form" method="post" action="{{url('admin/ebooks/update')}}" enctype="multipart/form-data">
                            <div class="form-group">
                                <label>书籍名称</label>
                                <input class="form-control" name="b_name" maxlength="14" value="{{$book->b_name}}" disabled>
                            </div>
                            
                            <div class="form-group">
                                <label>书籍封面</label>
                                <img src="{{$book->b_pic}}">
                                <input type="file" name="pic">
                            </div>

                            <div class="form-group">
                                <label>是否完结</label>
                                <label class="radio-inline">
                                    <input type="radio" name="isend" id="optionsRadiosInline1" value="0" @if($book -> isend == 0)
                                                          checked 
                                                        @endif>完结
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="isend" id="optionsRadiosInline2" value="1" @if($book -> isend == 1)
                                                          checked 
                                                        @endif>连载
                                </label>
                                <input type="hidden" name="id" value="{{$book->id}}">
                            </div>

                            {{csrf_field()}}

                            <button type="submit" class="btn btn-primary btn-lg btn-block">修改书籍</button>
             
                        </form>
                    </div>
                </div>
                <!-- /.row (nested) -->
            </div>
            <!-- /.panel-body -->
        </div>
        <!-- /.panel -->
    </div>
    <!-- /.col-lg-12 -->
</div>


@endsection